﻿
<?php
if(isset($_SESSION) && ($GLOBALS['USER']['level'] >= 2 || $GLOBALS['USER']['admin'])){

?>
   
<h2>Exportation</h2>
   <div class="creeFichier">
      
      <form enctype="multipart/form-data" action="pages/requetes/export_structures_resultat.php" method="post"> 
      
         <input type="hidden" name="max_file_size" value="2000000">
         
         <div class="subtitle43"> Champs </div>
         
            <div class="expTitle">        
               <span id="lblNom" class="label1Selected">
                  Nom
               </span>
               <span class="checkbox1"> 
                  <input type="checkbox" id="nom" name="nom" checked="checked" onclick="this.checked=true">
               </span>
            </div>
            
            <div class="expTitle">        
               <span id="lblNumcor" class="label1Selected">
                  Numcor
               </span>
               <span class="checkbox1"> 
                  <input type="checkbox" id="Numcor" name="Numcor" checked="checked" onclick="this.checked=true">
               </span>
            </div>
            
            <div class="expTitle">        
               <span id="lblAdresse" class="label1">
                  Adresse
               </span>
               <span class="checkbox1"> 
                  <input type="checkbox" id="Adresse" name="Adresse" onChange="enlightSelection('Adresse','lblAdresse')">
               </span>
            </div>
            <div class="expTitle">        
               <span id="lblCP" class="label1">
                 	Code Postal
               </span>
               <span class="checkbox1"> 
                  <input type="checkbox" id="CP" name="CP" onChange="enlightSelection('CP','lblCP')">
               </span>
            </div>
               <div class="expTitle">        
                  <span id="lblVille" class="label1">
                     Ville
                  </span>
                  <span class="checkbox1"> 
                     <input type="checkbox" id="Ville" name="Ville" onChange="enlightSelection('Ville','lblVille')">
                  </span>
               </div>
               
               <div class="expTitle">        
                  <span id="lblPays" class="label1">
                     Pays
                  </span>
                  <span class="checkbox1"> 
                     <input type="checkbox" id="Pays" name="Pays" onChange="enlightSelection('Pays','lblPays')">
                  </span>
               </div>
               
               
            
            <div class="expTitle">        
               <span id="lblLastC" class="label1">
                  Date Dernier Contact
               </span>
               <span class="checkbox1"> 
                  <input type="checkbox" id="LastC" name="LastC" onChange="enlightSelection('LastC','lblLastC')">
               </span>
            </div>
            <div class="expTitle">        
               <span id="lblTel" class="label1">
                  N° de Téléphone
               </span>
               <span class="checkbox1"> 
                  <input type="checkbox" id="Tel" name="Tel" onChange="enlightSelection('Tel','lblTel')">
               </span>
            </div>
            <div class="expTitle">        
               <span id="lblFax" class="label1">
                  N° de Fax
               </span>
               <span class="checkbox1"> 
                  <input type="checkbox" id="Fax" name="Fax" onChange="enlightSelection('Fax','lblFax')">
               </span>
            </div>
            <div class="expTitle">        
               <span id="lblEmail" class="label1">
                  Email
               </span>
               <span class="checkbox1"> 
                  <input type="checkbox" id="Email" name="Email" onChange="enlightSelection('Email','lblEmail')">
               </span>
            </div>
            <div class="expTitle">        
               <span id="lblWeb" class="label1">
                  Site Internet
               </span>
               <span class="checkbox1"> 
                  <input type="checkbox" id="Web" name="Web" onChange="enlightSelection('Web','lblWeb')">
               </span>
            </div>
            
            <div class="expTitle">
            
            <div class="subtitle43"> Informations Supplémentaires </div>  
            <div class="expTitle">
               <span class="label2">
                  Date de Dernier contact supérieure à
               </span>
               <span class="input2"> 
                  <input type="text" name="lastCsup" value="">
               </span>
            </div>
            
            <div class="expTitle">
               <span class="label2">
                  Ville
               </span>
               <span class="input2"> 
                  <input type="text" name="withVille" value="">
               </span>
            </div>
            
            <div class="expTitle">
               <span class="label2">
                  Pays
               </span>
               <span class="input2"> 
                  <input type="text" name="withPays" value="">
               </span>
            </div>
            
               <span class="submit1">
                  <input type="submit" name="export" value="Exporter">
               </span>
            </div>
         </form>
   </div>
<div class="information">
	<div class="titre">Informations</div>
	<h4>Remarque :</h4>
	<p>Pour ouvrir le fichier correctement dans un logiciel, il faut préciser que le caractère séparateur est une virgule ","
	et que les guillets double sont les séparateur de texte.</p>
</div>
<?php

}
else{
		if(isset($_SESSION)){
			if(!isset($_SESSION['user_id'])){ // si l'utilisateur n'est pas connecté
				include("pages/connexion.php");
			}else{ // si l'utilisateur est connecté et qu'il n'a pas accès à la page, c'est qu'il n'a pas le droit d'utilisation nécessaire
				include("pages/401.htm");
			}
		}
	}
?>